package com.kaochong.xcx.web.aspect;

/**
 * 登录用户信息
 *
 * @author han
 * @date 2018-05-01 16:49
 */
public class UserContext {
  private static final ThreadLocal<CurrentUser> USER_HOLDER = new ThreadLocal<>();
  
  public static void setUser(CurrentUser user){
    USER_HOLDER.set(user);
  }
  
  public static void remove() {
    USER_HOLDER.remove();
  }
  
  public static CurrentUser getUser() {
    return USER_HOLDER.get();
  }

}
